// FileImportPanel.less
// 自定义变量
@primary-color: #4361ee; // 现代蓝色
@secondary-color: #3a0ca3; // 深蓝色
@light-bg: #f8f9fa;
@border-color: #e9ecef;
@text-color: #212529;
@text-secondary: #6c757d;
@success-color: #4cc9f0; // 亮蓝色
@error-color: #f72585; // 粉色

.file-import {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);

  // 选项标签样式
  .options {
    padding: 16px 24px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid @border-color;

    .option-group {
      display: flex;
      gap: 12px;

      .option {
        flex: 1;
        padding: 20px 16px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: white;
        border: 1px solid @border-color;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(67, 97, 238, 0.15);
          border-color: @primary-color;
        }

        &.active {
          background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(58, 12, 163, 0.05) 100%);
          border: 1px solid @primary-color;

          .icon {
            background: @primary-color;
            color: white;
          }
        }

        .icon {
          font-size: 20px;
          margin-bottom: 12px;
          width: 40px;
          height: 40px;
          border-radius: 50%;
          display: flex;
          align-items: center;
          justify-content: center;
          background: @light-bg;
          color: @primary-color;
          transition: all 0.3s;
        }

        .label {
          font-weight: 600;
          font-size: 15px;
          margin-bottom: 6px;
          color: @text-color;
        }

        .description {
          font-size: 12px;
          color: @text-secondary;
          line-height: 1.4;
        }
      }
    }
  }

  // 主要内容区域
  .content {
    flex: 1;
    padding: 24px;
    overflow: auto;
    background: white;
    display: flex;
    flex-direction: column;

    .file-content {
      padding: 24px;
      background: white;
      border-radius: 10px;
      border: 1px solid @border-color;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
      width: 45%;
      height: 100%;

      .section-description {
        color: @text-secondary;
        margin: 16px 0 24px;
        font-size: 13px;
        line-height: 1.5;
      }

      // 上传区域美化
      .ant-upload.ant-upload-drag {
        border: 2px dashed rgba(67, 97, 238, 0.3);
        border-radius: 10px;
        padding: 32px 16px;
        background: rgba(248, 249, 250, 0.5);
        transition: all 0.3s;

        &:hover {
          border-color: @primary-color;
          background: rgba(67, 97, 238, 0.03);

          .ant-upload {
            &-text {
              color: @primary-color;
            }
          }
        }

        .ant-upload {
          &-btn {
            padding: 0;
          }

          &-text {
            font-weight: 500;
            color: @text-color;
            margin: 8px 0 4px;
            font-size: 15px;
            transition: color 0.3s;
          }

          &-hint {
            font-size: 13px;
            color: @text-secondary;
          }

          &-icon {
            .anticon {
              font-size: 40px;
              color: @primary-color;
              margin-bottom: 12px;
            }
          }
        }
      }

      // 输入控件组样式
      .input-control-group {
        display: flex;
        align-items: center;
        margin-bottom: 16px;

        .control-label {
          width: 100px;
          margin: 0;
          text-align: right;
          padding-right: 16px;
          font-size: 14px;
          color: @text-color;
          font-weight: 500;
        }

        .control-input {
          flex: 1;

          .ant-input, .ant-select-selector {
            border-radius: 6px !important;
            border: 1px solid @border-color;
            transition: all 0.3s;

            &:hover {
              border-color: @primary-color;
            }

            &:focus {
              box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
            }
          }
        }
      }
    }
  }
}



// 动画效果
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.preview-item {
  animation: fadeIn 0.3s ease-out forwards;
}

.preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #f8fafc;
  border-radius: 12px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);

  .preview-header {
    padding: 4px 24px;
    height: 48px;
    background: white;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;

    h3 {
      margin: 0;
      font-size: 16px;
      font-weight: 600;
      color: #1e293b;
      display: flex;
      align-items: center;

      .anticon {
        margin-right: 8px;
        color: @primary-color;
      }
    }

    .preview-stats {
      font-size: 13px;
      color: #64748b;
      background: #f1f5f9;
      padding: 4px 8px;
      border-radius: 4px;
    }
  }

  .preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    .empty-preview {
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      color: #94a3b8;

      .anticon {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.6;
      }

      p {
        margin: 8px 0;
        font-size: 14px;
      }
    }

    .preview-list {
      .ant-list-item {
        padding: 20px;
        margin-bottom: 12px;
        background: white;
        border-radius: 8px;
        border: 1px solid #e2e8f0;
        transition: all 0.2s ease;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(67, 97, 238, 0.08);
          border-color: @primary-color;
        }

        .ant-list-item-meta {
          align-items: center;

          &-avatar {
            .segment-badge {
              display: flex;
              align-items: center;
              justify-content: center;
              width: 32px;
              height: 32px;
              border-radius: 50%;
              background: rgba(67, 97, 238, 0.1);
              color: @primary-color;
              font-weight: 600;
              font-size: 14px;
            }
          }

          &-title {
            margin-bottom: 8px;

            a {
              color: #334155;
              font-weight: 500;
              font-size: 15px;

              &:hover {
                color: @primary-color;
              }
            }
          }

          &-description {
            color: #475569;
            font-size: 14px;
            line-height: 1.6;
            white-space: pre-wrap;
            background: #f8fafc;
            padding: 12px;
            border-radius: 6px;
            border-left: 3px solid #e2e8f0;
            transition: all 0.2s;

            &:hover {
              border-left-color: @primary-color;
              background: white;
            }
          }
        }
      }
    }
  }

}
